package com.bnzj.core.action;

import lombok.Getter;

import java.util.Arrays;

/**
 * @author Barry
 * @createDate 2020/4/10
 * @description
 */
@Getter
public enum ActionType {
    UNKNOWN("未定义"),
    LOG_IN("登录"),
    QUERY_DATA("查询"),
    ADD_DATA("添加"),
    UPDATE_DATA("修改"),
    DELETE_DATA("删除"),
    IMPORT_DATA("导入"),
    EXPORT_DATA("导出");

    private String message;

    ActionType(String message) {
        this.message = message;
    }

    public static ActionType getEnumType(int ordinal) {
        return Arrays.asList(ActionType.values()).stream().filter(alarmGrade -> alarmGrade.ordinal() == (ordinal))
            .findFirst().orElse(ActionType.UNKNOWN);
    }

}
